package com.evan.uyclub.HomeFragment;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.text.Html;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.cardview.widget.CardView;

import com.evan.uyclub.Bizhi.ActivityBizhi;
import com.evan.uyclub.GameBa.Game;
import com.evan.uyclub.Other.Utlis;
import com.evan.uyclub.OtherImageTool.EkiCode;
import com.evan.uyclub.OtherImageTool.MaoBoImg;
import com.evan.uyclub.OtherImageTool.PictureClarityActivity;
import com.evan.uyclub.OtherImageTool.PictureColorActivity;
import com.evan.uyclub.OtherImageTool.PictureColoringActivity;
import com.evan.uyclub.OtherImageTool.PictureUrlActivity;
import com.evan.uyclub.OtherImageTool.SearchImageActivity;
import com.evan.uyclub.OtherImageTool.YacuoImg;
import com.evan.uyclub.R;
import com.evan.uyclub.SevenTool.BiliBiliActivity;
import com.evan.uyclub.SevenTool.DeWatermark1Activity;
import com.evan.uyclub.SevenTool.DeWatermarkActivity;
import com.evan.uyclub.SevenTool.ExtractAudioActivity;
import com.evan.uyclub.SevenTool.GifmakerPictureActivity;
import com.evan.uyclub.SevenTool.KSongActivity;
import com.evan.uyclub.SevenTool.LanzouActivity;
import com.evan.uyclub.SevenTool.NeteaseSongActivity;
import com.evan.uyclub.SevenTool.WebPictureActivity;
import com.evan.uyclub.SexTool.ClockActivity;
import com.evan.uyclub.SexTool.CompassActivity;
import com.evan.uyclub.SexTool.DayNewsActivity;
import com.evan.uyclub.SexTool.DrawActivity;
import com.evan.uyclub.SexTool.HistoryActivity;
import com.evan.uyclub.SexTool.IptvActivity;
import com.evan.uyclub.SexTool.LedActivity;
import com.evan.uyclub.SexTool.LevelActivity;
import com.evan.uyclub.SexTool.LoveTalkActivity;
import com.evan.uyclub.SexTool.ScreenActivity;
import com.evan.uyclub.SexTool.ShortUrlActivity;
import com.evan.uyclub.SexTool.TransactionActivity;
import com.evan.uyclub.SexTool.VideoSearchActivity;
import com.evan.uyclub.SexTool.VideoWallpaperActivity;
import com.evan.uyclub.SexTool.VipVideoActivity;
import com.evan.uyclub.SexTool.WebCodeActivity;
import com.evan.uyclub.ThreeTool.DictionaryActivity;
import com.evan.uyclub.ThreeTool.MiniEnglishActivity;
import com.evan.uyclub.ThreeTool.RandomArticleActivity;
import com.evan.uyclub.ThreeTool.SmallDigitActivity;
import com.evan.uyclub.ThreeTool.SpecialTextActivity;
import com.evan.uyclub.Touxiang.ActivityTouxiang;
import com.evan.uyclub.TwoTool.AbbreviatedActivity;
import com.evan.uyclub.TwoTool.EmoticonActivity;
import com.evan.uyclub.TwoTool.IconSearchActivity;
import com.evan.uyclub.TwoTool.IpSiteActivity;
import com.evan.uyclub.TwoTool.MusicActivity;
import com.evan.uyclub.TwoTool.PhoneAttributionActivity;
import com.evan.uyclub.TwoTool.RubbishActivity;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.sdsmdg.tastytoast.TastyToast;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;

import in.codeshuffle.typewriterview.TypeWriterView;

/**
 * @noinspection DataFlowIssue
 */
public class ToolFragment extends LazyFragment {
    private TwinklingRefreshLayout app_s;
    private View view;
    private SharedPreferences data;
    TypeWriterView typeWriterView;
    private TextView tool_gg, app_name, tool_text, tool_text1, tool_text2, tool_text3, tool_text4, tool_text5, tool_text6, tool_english_text, tool_english_text1, tool_english_text2, tool_english_text3, tool_english_text4, tool_english_text5, tool_english_text6, tool_text7, getTool_english_text7;
    private CardView Tool_one, Tool_two, Tool_three, Tool_five, Tool_sex, Tool_seven, Tool_game, Tool_eight;
    private LinearLayout Tool_one_0, Tool_one_1, Tool_one_2, Tool_one_3, Tool_one_4, Tool_one_5, Tool_one_6, Tool_one_7, Tool_one_8, Tool_one_9, Tool_one_10, Tool_one_11, Tool_one_12, Tool_one_13, Tool_one_14, Tool_one_15, Tool_one_16, Tool_one_17;
    private LinearLayout Tool_two_0, Tool_two_1, Tool_two_2, Tool_two_3, Tool_two_4, Tool_two_5, Tool_two_6, Tool_two_7, Tool_two_8, Tool_two_9, Tool_two_10;
    private BottomSheetDialog bottomSheetDialog;

   /* @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_tool, container, false);
        return view;
    }*/

    @Override
    protected int getContentViewId() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView(View views) {
        view = views;
    }

    @Override
    protected void initData() {
        initRequestData();
    }

    @Override
    protected void initEvent() {
        initUI();
        Tool();
    }

    public void initUI() {
        //实现回弹效果，支持带列表的。
        SmartRefreshLayout home_smart = (SmartRefreshLayout) view.findViewById(R.id.tool_smart);
        home_smart.setEnableLoadMore(true);
        home_smart.setEnablePureScrollMode(true);
        //设置对应xml界面的字体
        TextView up_title = view.findViewById(R.id.up);
        TextView cloud_title = view.findViewById(R.id.cloud);
        app_name = view.findViewById(R.id.app_name);
        up_title.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), "english.ttf"));
        cloud_title.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), "english.ttf"));
        app_name.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), "english.ttf"));
        String tooltext = "rubik.ttf";
        String toolenglishtext = "rubik.ttf";
        TextView tool_text = view.findViewById(R.id.tool_text);
        TextView tool_text1 = view.findViewById(R.id.tool_text1);
        TextView tool_text2 = view.findViewById(R.id.tool_text2);
        TextView tool_text3 = view.findViewById(R.id.tool_text3);
        TextView tool_text4 = view.findViewById(R.id.tool_text4);
        TextView tool_text5 = view.findViewById(R.id.tool_text5);
        TextView tool_text6 = view.findViewById(R.id.tool_text6);
        tool_text7 = view.findViewById(R.id.tool_text7);
        TextView tool_english_text = view.findViewById(R.id.tool_english_text);
        TextView tool_english_text1 = view.findViewById(R.id.tool_english_text1);
        TextView tool_english_text2 = view.findViewById(R.id.tool_english_text2);
        TextView tool_english_text3 = view.findViewById(R.id.tool_english_text3);
        TextView tool_english_text4 = view.findViewById(R.id.tool_english_text4);
        TextView tool_english_text5 = view.findViewById(R.id.tool_english_text5);
        TextView tool_english_text6 = view.findViewById(R.id.tool_english_text6);
        getTool_english_text7 = view.findViewById(R.id.tool_english_text7);
        tool_text.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text1.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text2.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text3.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text4.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text5.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text6.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_text7.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), tooltext));
        tool_english_text.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text1.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text2.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text3.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text4.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text5.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        tool_english_text6.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        getTool_english_text7.setTypeface(Typeface.createFromAsset(requireActivity().getAssets(), toolenglishtext));
        //设置回弹布局效果
        /*app_s=view.findViewById(R.id.app_s);
        app_s.setPureScrollModeOn();*/
    }

    public void Tool() {
        /** Tool_one  **/
        Tool_one = view.findViewById(R.id.Tool_one);
        Tool_one.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog dialog = new BottomSheetDialog(requireActivity());
                    //  dialog= new BottomSheetDialog(requireActivity(),R.style.dialogs);
                    View dialog1 = getLayoutInflater().inflate(R.layout.tool_one, null);
                    dialog.setContentView(dialog1);
                    dialog.setCancelable(true);
                    dialog.setCanceledOnTouchOutside(true);
                    dialog.show();
                    dialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);

                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                    Tool_one_5 = dialog.findViewById(R.id.Tool_one_5);
                    Tool_one_5.setOnClickListener(this::onClicks);
                    Tool_one_7 = dialog.findViewById(R.id.Tool_one_7);
                    Tool_one_7.setOnClickListener(this::onClicks);
                    Tool_one_8 = dialog.findViewById(R.id.Tool_one_8);
                    Tool_one_8.setOnClickListener(this::onClicks);
                    Tool_one_9 = dialog.findViewById(R.id.Tool_one_9);
                    Tool_one_9.setOnClickListener(this::onClicks);
                    Tool_one_10 = dialog.findViewById(R.id.Tool_one_10);
                    Tool_one_10.setOnClickListener(this::onClicks);
                }
            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent = new Intent();
                        intent.setClass(getActivity(), ActivityTouxiang.class);
                        startActivity(intent);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), ActivityBizhi.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), PictureColorActivity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), YacuoImg.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), MaoBoImg.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_5:
                        Intent intent5 = new Intent();
                        intent5.setClass(getActivity(), SearchImageActivity.class);
                        startActivity(intent5);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_7:
                        Intent intent7 = new Intent();
                        intent7.setClass(getActivity(), PictureUrlActivity.class);
                        startActivity(intent7);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_8:
                        Intent intent8 = new Intent();
                        intent8.setClass(getActivity(), PictureClarityActivity.class);
                        startActivity(intent8);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_9:
                        Intent intent9 = new Intent();
                        intent9.setClass(getActivity(), PictureColoringActivity.class);
                        startActivity(intent9);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_10:
                        Intent intent10 = new Intent();
                        intent10.setClass(getActivity(), EkiCode.class);
                        startActivity(intent10);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                }
            }
        });

        /** Tool_two  **/
        Tool_two = view.findViewById(R.id.Tool_two);
        Tool_two.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireActivity());
                    View dialog = getLayoutInflater().inflate(R.layout.tool_two, null);
                    bottomSheetDialog.setContentView(dialog);
                    bottomSheetDialog.setCancelable(true);
                    bottomSheetDialog.setCanceledOnTouchOutside(true);
                    bottomSheetDialog.show();
                    bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                    Tool_one_5 = dialog.findViewById(R.id.Tool_one_5);
                    Tool_one_5.setOnClickListener(this::onClicks);
                    Tool_one_6 = dialog.findViewById(R.id.Tool_one_6);
                    Tool_one_6.setOnClickListener(this::onClicks);
                }
            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent0 = new Intent();
                        intent0.setClass(getActivity(), RubbishActivity.class);
                        startActivity(intent0);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), MusicActivity.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), AbbreviatedActivity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), EmoticonActivity.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), IconSearchActivity.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_5:
                        Intent intent5 = new Intent();
                        intent5.setClass(getActivity(), PhoneAttributionActivity.class);
                        startActivity(intent5);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_6:
                        Intent intent6 = new Intent();
                        intent6.setClass(getActivity(), IpSiteActivity.class);
                        startActivity(intent6);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                }
            }
        });

        /** Tool_three **/
        Tool_three = view.findViewById(R.id.Tool_three);
        Tool_three.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireActivity());
                    View dialog = getLayoutInflater().inflate(R.layout.tool_three, null);
                    bottomSheetDialog.setContentView(dialog);
                    bottomSheetDialog.setCancelable(true);
                    bottomSheetDialog.setCanceledOnTouchOutside(true);
                    bottomSheetDialog.show();
                    bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                }

            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent0 = new Intent();
                        intent0.setClass(getActivity(), SpecialTextActivity.class);
                        startActivity(intent0);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), SmallDigitActivity.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), MiniEnglishActivity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), DictionaryActivity.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), RandomArticleActivity.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;

                }
            }
        });


        /** Tool_five  **/
        Tool_five = view.findViewById(R.id.Tool_five);
        Tool_five.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog dialog = new BottomSheetDialog(requireActivity());
                    View dialog1 = getLayoutInflater().inflate(R.layout.tool_five, null);
                    dialog.setContentView(dialog1);
                    dialog.setCancelable(true);
                    dialog.setCanceledOnTouchOutside(true);
                    dialog.show();
                    dialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                    Tool_one_5 = dialog.findViewById(R.id.Tool_one_5);
                    Tool_one_5.setOnClickListener(this::onClicks);
                    Tool_one_6 = dialog.findViewById(R.id.Tool_one_6);
                    Tool_one_6.setOnClickListener(this::onClicks);
                    Tool_one_7 = dialog.findViewById(R.id.Tool_one_7);
                    Tool_one_7.setOnClickListener(this::onClicks);
                    Tool_one_8 = dialog.findViewById(R.id.Tool_one_8);
                    Tool_one_8.setOnClickListener(this::onClicks);
                    Tool_one_9 = dialog.findViewById(R.id.Tool_one_9);
                    Tool_one_9.setOnClickListener(this::onClicks);
                }
            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent = new Intent();
                        intent.setClass(getActivity(), PictureColorActivity.class);
                        startActivity(intent);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), PictureUrlActivity.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), IconSearchActivity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), DayNewsActivity.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), VideoSearchActivity.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_5:
                        Intent intent5 = new Intent();
                        intent5.setClass(getActivity(), HistoryActivity.class);
                        startActivity(intent5);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_6:
                        Intent intent7 = new Intent();
                        intent7.setClass(getActivity(), DeWatermarkActivity.class);
                        startActivity(intent7);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_7:
                        Intent intent8 = new Intent();
                        intent8.setClass(getActivity(), ExtractAudioActivity.class);
                        startActivity(intent8);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_8:
                        Intent intent9 = new Intent();
                        intent9.setClass(getActivity(), NeteaseSongActivity.class);
                        startActivity(intent9);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_9:
                        Intent intent10 = new Intent();
                        intent10.setClass(getActivity(), GifmakerPictureActivity.class);
                        startActivity(intent10);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                }
            }
        });


        /** Tool_sex  **/

        Tool_sex = view.findViewById(R.id.Tool_sex);
        Tool_sex.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireActivity());
                    View dialog = getLayoutInflater().inflate(R.layout.tool_sex, null);
                    bottomSheetDialog.setContentView(dialog);
                    bottomSheetDialog.setCancelable(true);
                    bottomSheetDialog.setCanceledOnTouchOutside(true);
                    bottomSheetDialog.show();
                    bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                    Tool_one_5 = dialog.findViewById(R.id.Tool_one_5);
                    Tool_one_5.setOnClickListener(this::onClicks);
                    Tool_one_6 = dialog.findViewById(R.id.Tool_one_6);
                    Tool_one_6.setOnClickListener(this::onClicks);
                    Tool_one_7 = dialog.findViewById(R.id.Tool_one_7);
                    Tool_one_7.setOnClickListener(this::onClicks);
                    Tool_one_8 = dialog.findViewById(R.id.Tool_one_8);
                    Tool_one_8.setOnClickListener(this::onClicks);
                    Tool_one_9 = dialog.findViewById(R.id.Tool_one_9);
                    Tool_one_9.setOnClickListener(this::onClicks);
                    Tool_one_10 = dialog.findViewById(R.id.Tool_one_10);
                    Tool_one_10.setOnClickListener(this::onClicks);
                    Tool_one_11 = dialog.findViewById(R.id.Tool_one_11);
                    Tool_one_11.setOnClickListener(this::onClicks);
                    Tool_one_12 = dialog.findViewById(R.id.Tool_one_12);
                    Tool_one_12.setOnClickListener(this::onClicks);
                    Tool_one_13 = dialog.findViewById(R.id.Tool_one_13);
                    Tool_one_13.setOnClickListener(this::onClicks);
                    Tool_one_14 = dialog.findViewById(R.id.Tool_one_14);
                    Tool_one_14.setOnClickListener(this::onClicks);
                    Tool_one_15 = dialog.findViewById(R.id.Tool_one_15);
                    Tool_one_15.setOnClickListener(this::onClicks);
                }
            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent0 = new Intent();
                        intent0.setClass(getActivity(), CompassActivity.class);
                        startActivity(intent0);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), DayNewsActivity.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), ClockActivity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), ShortUrlActivity.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), DrawActivity.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_5:
                        Intent intent5 = new Intent();
                        intent5.setClass(getActivity(), HistoryActivity.class);
                        startActivity(intent5);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_6:
                        Intent intent7 = new Intent();
                        intent7.setClass(getActivity(), TransactionActivity.class);
                        startActivity(intent7);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_7:
                        Intent intent8 = new Intent();
                        intent8.setClass(getActivity(), ScreenActivity.class);
                        startActivity(intent8);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_8:
                        Intent intent9 = new Intent();
                        intent9.setClass(getActivity(), VideoWallpaperActivity.class);
                        startActivity(intent9);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_9:
                        Intent intent10 = new Intent();
                        intent10.setClass(getActivity(), LevelActivity.class);
                        startActivity(intent10);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_10:
                        Intent intent101 = new Intent();
                        intent101.setClass(getActivity(), LedActivity.class);
                        startActivity(intent101);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_11:
                        Intent intent11 = new Intent();
                        intent11.setClass(getActivity(), WebCodeActivity.class);
                        startActivity(intent11);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_12:
                        Intent intent12 = new Intent();
                        intent12.setClass(getActivity(), IptvActivity.class);
                        startActivity(intent12);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_13:
                        Intent intent13 = new Intent();
                        intent13.setClass(getActivity(), VipVideoActivity.class);
                        startActivity(intent13);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_14:
                        Intent intent14 = new Intent();
                        intent14.setClass(getActivity(), VideoSearchActivity.class);
                        startActivity(intent14);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_15:
                        Intent intent15 = new Intent();
                        intent15.setClass(getActivity(), LoveTalkActivity.class);
                        startActivity(intent15);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                }
            }
        });

        /** Tool_seven **/

        Tool_seven = view.findViewById(R.id.Tool_seven);
        Tool_seven.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireActivity());
                    View dialog = getLayoutInflater().inflate(R.layout.tool_seven, null);
                    bottomSheetDialog.setContentView(dialog);
                    bottomSheetDialog.setCancelable(true);
                    bottomSheetDialog.setCanceledOnTouchOutside(true);
                    bottomSheetDialog.show();
                    bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    Tool_one_0 = dialog.findViewById(R.id.Tool_one_0);
                    Tool_one_0.setOnClickListener(this::onClicks);
                    Tool_one_1 = dialog.findViewById(R.id.Tool_one_1);
                    Tool_one_1.setOnClickListener(this::onClicks);
                    Tool_one_2 = dialog.findViewById(R.id.Tool_one_2);
                    Tool_one_2.setOnClickListener(this::onClicks);
                    Tool_one_3 = dialog.findViewById(R.id.Tool_one_3);
                    Tool_one_3.setOnClickListener(this::onClicks);
                    Tool_one_4 = dialog.findViewById(R.id.Tool_one_4);
                    Tool_one_4.setOnClickListener(this::onClicks);
                    Tool_one_5 = dialog.findViewById(R.id.Tool_one_5);
                    Tool_one_5.setOnClickListener(this::onClicks);
                    Tool_one_6 = dialog.findViewById(R.id.Tool_one_6);
                    Tool_one_6.setOnClickListener(this::onClicks);
                    Tool_one_7 = dialog.findViewById(R.id.Tool_one_7);
                    Tool_one_7.setOnClickListener(this::onClicks);
                    Tool_one_8 = dialog.findViewById(R.id.Tool_one_8);
                    Tool_one_8.setOnClickListener(this::onClicks);
                    Tool_one_9 = dialog.findViewById(R.id.Tool_one_9);
                    Tool_one_9.setOnClickListener(this::onClicks);
                }
            }

            @SuppressLint("NonConstantResourceId")
            public void onClicks(View v) {
                switch (v.getId()) {
                    case R.id.Tool_one_0:
                        Intent intent0 = new Intent();
                        intent0.setClass(getActivity(), NeteaseSongActivity.class);
                        startActivity(intent0);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_1:
                        Intent intent1 = new Intent();
                        intent1.setClass(getActivity(), KSongActivity.class);
                        startActivity(intent1);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_2:
                        Intent intent2 = new Intent();
                        intent2.setClass(getActivity(), DeWatermark1Activity.class);
                        startActivity(intent2);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_3:
                        Intent intent3 = new Intent();
                        intent3.setClass(getActivity(), DeWatermarkActivity.class);
                        startActivity(intent3);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_4:
                        Intent intent4 = new Intent();
                        intent4.setClass(getActivity(), LanzouActivity.class);
                        startActivity(intent4);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_5:
                        Intent intent5 = new Intent();
                        intent5.setClass(getActivity(), WebPictureActivity.class);
                        startActivity(intent5);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_6:
                        Intent intent7 = new Intent();
                        intent7.setClass(getActivity(), GifmakerPictureActivity.class);
                        startActivity(intent7);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_7:
                        Intent intent8 = new Intent();
                        intent8.setClass(getActivity(), BiliBiliActivity.class);
                        startActivity(intent8);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_8:
                        Intent intent9 = new Intent();
                        intent9.setClass(getActivity(), ExtractAudioActivity.class);
                        startActivity(intent9);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                    case R.id.Tool_one_9:
                        Intent intent10 = new Intent();
                        intent10.setClass(getActivity(), PictureUrlActivity.class);
                        startActivity(intent10);
                        requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                        break;
                }
            }
        });

        /* Tool_Game */
        Tool_game = view.findViewById(R.id.Tool_game);
        Tool_game.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    Intent intent10 = new Intent();
                    intent10.setClass(getActivity(), Game.class);
                    startActivity(intent10);
                    requireActivity().overridePendingTransition(R.anim.activity_visible, R.anim.activity_gone);
                }
            }
        });

        Tool_eight = view.findViewById(R.id.Tool_eight);
        Tool_eight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!Utlis.isVPNConnected(getContext())) {
                    bottomSheetDialog = new BottomSheetDialog(requireActivity());
                    View dialog = getLayoutInflater().inflate(R.layout.tool_eight, null);
                    bottomSheetDialog.setContentView(dialog);
                    bottomSheetDialog.setCancelable(true);
                    bottomSheetDialog.setCanceledOnTouchOutside(true);
                    bottomSheetDialog.show();
                    bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(R.color.bantouming);
                    CardView cardView = dialog.findViewById(R.id.tianjia);
                    cardView.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            TastyToast.makeText(getContext(), "暂无权限", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING).show();
                            bottomSheetDialog.dismiss();
                        }
                    });
                }
            }
        });
    }

    private void initRequestData() {
        tool_gg = view.findViewById(R.id.tool_gg);
        typeWriterView = view.findViewById(R.id.typeWriterView);
        if (!Utlis.isVPNConnected(getContext())) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    EasyHttp.get("https://uyclouds.com/uyapi/file_text.php")
                            .params("keeper", "3487297072")
                            .params("api", "488588")
                            .params("title", "apptool")
                            .execute(new SimpleCallBack<String>() {
                                @Override
                                public void onSuccess(String data) {
                                    // 在UI线程更新TextView的内容
                                    requireActivity().runOnUiThread(new Runnable() {
                                        @Override
                                        public void run() {
                                            /*tool_gg.setText(Html.fromHtml(data));*/
                                            //Setting each character animation delay
                                            typeWriterView.setDelay(400);
                                            //Setting music effect On/Off
                                            typeWriterView.setWithMusic(true);
                                            //Animating Text
                                            typeWriterView.animateText(String.valueOf(Html.fromHtml(data)));
                                        }
                                    });
                                }

                                @Override
                                public void onError(ApiException e) {
                                    e.printStackTrace();
                                }
                            });
                }
            }).start();
        }
    }

}